<@override name="page-title">
添加附件
</@override>
<@override name="page-style">
<link rel="stylesheet" href="/assets/admin/css/plugins/file-upload/bootstrap-fileupload.css">
</@override>
<@override name="page-body">

<div class="ibox-content">
    <form class="form-horizontal m-t" id="updateForm" enctype="multipart/form-data">
        <div class="form-group">
            <label class="col-xs-3 control-label">标题：</label>
            <div class="col-xs-8">
                <input type="text" class="form-control" value="" id="name" name="name"
                       placeholder="请输入标题"
                       minlength="2" required="" aria-required="true">
            </div>
        </div>
      <div class="form-group">
            <label class="col-xs-3 control-label">发布日期：</label>
            <div class="col-xs-8">
                <div class="input-group date" id="pubdateDiv">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input type="text" class="form-control" value=""
                           placeholder="请输入发布时间" name="att_creat_time">
                </div>
            </div>
        </div>
        <div class="form-group">
        	<label class="col-xs-3 control-label">附件上传：</label>
        	<div class="col-xs-8">
        		<input type="file" name="upattachmentfile">
        	</div>
        </div>
        
   

        <div class="form-group">
            <div class="col-xs-12 col-xs-offset-4">
                <button class="btn btn-primary" type="submit">保存</button>
                &nbsp;&nbsp;&nbsp;&nbsp;
                <button onClick="layer_close();" class="btn btn-default radius" type="button">
                    取消
                </button>
            </div>
        </div>
    </form>
</div>
</@override>
<@override name="page-script">
<script type="text/javascript" src="/assets/admin/js/plugins/iCheck/icheck.min.js"></script>
<script type="text/javascript" src="/assets/admin/js/plugins/validate/jquery.validate.min.js"></script>
<script type="text/javascript" src="/assets/admin/js/plugins/validate/messages_zh.min.js"></script>
<script src="/assets/admin/js/plugins/file-upload/bootstrap-fileupload.js"></script>
<script src="/assets/admin/js/plugins/jquery-form/jquery.form.js"></script>
<script src="/assets/admin/js/plugins/datapicker/bootstrap-datepicker.js"></script>
<script src="/assets/admin/plugins/ueditor/ueditor.config.js"></script>
<script src="/assets/admin/plugins/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
	$("#pubdateDiv").datepicker({
            autoclose: !0,
            clearBtn: true,
            todayHighlight: true
    });
    $(function () {
        $("#updateForm").validate({
            submitHandler: function (form) {
                var index = parent.layer.getFrameIndex(window.name);
                $(form).ajaxSubmit({
                    url: "/admin/attachment/save.json",
                    type: "POST",
                    success: function (data) {
                        if (data.ret) {
                            parent.$("#layer-data").val('1');
                        } else {
                            parent.$("#layer-data").val(data.errmsg);
                        }
                        parent.layer.close(index);
                    }
                });
            }
        })
    })
    ;
</script>
</@override>
<@extends name="admin/common/common.ftl"/>